;Assembler header file for Podule
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:03:54 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Aug 1995

        [       :LNOT: :DEF: Podule_Hdr
        GBLS    Podule_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

;Symbols for constants
Podule_SectionSystemROM         *       &FFFFFFFF
Podule_SectionExpansionCard0    *       &0
Podule_SectionExpansionCard1    *       &1
Podule_SectionExpansionCard2    *       &2
Podule_SectionExpansionCard3    *       &3
Podule_SectionExtensionROM1     *       &FFFFFFFE
Error_PoduleBadPod              *       &500
Error_PoduleBadSpeed            *       &501
Error_PoduleNoPod               *       &502
Error_PoduleNotExt              *       &503
Error_PoduleNotAcrn             *       &504
Error_PoduleNoLdr               *       &505
Error_PoduleInLdr               *       &506
Error_PoduleBadChnk             *       &507
Error_PoduleBadDeviceNumber     *       &508
Error_PoduleBadDeviceType       *       &509
Error_PoduleRAMConfigSyntax     *       &50A
Error_PoduleWrongPoduleType     *       &50B
Error_PoduleROMBoardSyntax      *       &50C
Error_PoduleBadRead             *       &50D
Error_PoduleBdSpeed             *       &50E
Error_PoduleNotEASI             *       &50F
Error_PoduleSpeedNo             *       &510
Error_PoduleECNoSpd             *       &511
Error_PoduleECNoNet             *       &512
Error_PoduleNDallas             *       &513
Error_PoduleNotWritable         *       &580
Error_PoduleAddressRange        *       &581
Error_PoduleDeviceNotWritable   *       &582
Error_PodulePoduleReadOnly      *       &583
Error_PoduleAddressTooBig       *       &584

;Symbols for structure offsets and sizes
                                ^       0
                                #       Int
Podule_Section                  *       @

                                ^       0
Podule_Header_b                 #       16*Byte
Podule_Header                   *       @


;Symbols for SWI's and SWI reason codes
XPodule_ReadID                  *       &60280
Podule_ReadID                   *       &40280
   ;Entry
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R0 = ec_id (Int)

XPodule_ReadHeader              *       &60281
Podule_ReadHeader               *       &40281
   ;Entry
   ;  R2 = header (pointer to Podule_Header)
   ;  R3 = section (Podule_Section)

XPodule_EnumerateChunks         *       &60282
Podule_EnumerateChunks          *       &40282
   ;Entry
   ;  R0 = context (Int)
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R0 = context_out (Int)
   ;  R1 = size (Int)
   ;  R2 = os_id (Byte)
   ;  R4 -> module_name (String)

XPodule_ReadChunk               *       &60283
Podule_ReadChunk                *       &40283
   ;Entry
   ;  R0 = chunk_no (Int)
   ;  R2 = buffer (pointer to data)
   ;  R3 = section (Podule_Section)

XPodule_ReadBytes               *       &60284
Podule_ReadBytes                *       &40284
   ;Entry
   ;  R0 = start_offset (Int)
   ;  R1 = size (Int)
   ;  R2 = buffer (pointer to data)
   ;  R3 = slot_no (Int)

XPodule_WriteBytes              *       &60285
Podule_WriteBytes               *       &40285
   ;Entry
   ;  R0 = start_offset (Int)
   ;  R1 = size (Int)
   ;  R2 -> buffer (data)
   ;  R3 = slot_no (Int)

XPodule_CallLoader              *       &60286
Podule_CallLoader               *       &40286
   ;Entry
   ;  R0 = arg0 (Int)
   ;  R1 = arg1 (Int)
   ;  R2 = arg2 (Int)
   ;  R3 = slot_no (Int)
   ;Exit
   ;  R0 = arg0_out (Int)
   ;  R1 = arg1_out (Int)
   ;  R2 = arg2_out (Int)

XPodule_RawRead                 *       &60287
Podule_RawRead                  *       &40287
   ;Entry
   ;  R0 = start_offset (Int)
   ;  R1 = size (Int)
   ;  R2 = buffer (pointer to data)
   ;  R3 = slot_no (Int)

XPodule_RawWrite                *       &60288
Podule_RawWrite                 *       &40288
   ;Entry
   ;  R0 = start_offset (Int)
   ;  R1 = size (Int)
   ;  R2 -> buffer (data)
   ;  R3 = slot_no (Int)

XPodule_HardwareAddress         *       &60289
Podule_HardwareAddress          *       &40289
   ;Entry
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R3 = combined_addr (pointer to Int)

XPodule_EnumerateChunksWithInfo *       &6028A
Podule_EnumerateChunksWithInfo  *       &4028A
   ;Entry
   ;  R0 = context (Int)
   ;  R3 = section (Podule_Section)
   ;  R6 = &1
   ;Exit
   ;  R0 = context_out (Int)
   ;  R1 = size (Int)
   ;  R2 = os_id (Byte)
   ;  R4 -> module_name (String)
   ;  R5 -> help_text (String)
   ;  R6 = module_base (pointer to Int)

XPodule_HardwareAddresses       *       &6028B
Podule_HardwareAddresses        *       &4028B
   ;Entry
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R0 = base_addr (pointer to Int)
   ;  R1 = combined_addr (pointer to Int)

XPodule_ReturnNumber            *       &6028C
Podule_ReturnNumber             *       &4028C
   ;Exit
   ;  R0 = expansion_card_count (Int)
   ;  R1 = extension_rom_count (Int)

XPodule_ReadInfo                *       &6028D
Podule_ReadInfo                 *       &4028D
   ;Entry
   ;  R0 = mask (Bits)
   ;  R1 = buffer (pointer to data)
   ;  R2 = size (Int)
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R2 = used (Int)

XPodule_SetSpeed                *       &6028E
Podule_SetSpeed                 *       &4028E
   ;Entry
   ;  R0 = speed (Int)
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R0 = old_speed (Int)

Service_PreReset                *       &45
   ;Entry
   ;  R1 = &45

Service_ADFSPodule              *       &10800
   ;Entry
   ;  R1 = &10800
   ;  R2 = controller (pointer to data)
   ;  R3 = status_location (pointer to Int)
   ;  R4 = status_bits (Bits)
   ;  R5 = irq_location (pointer to Int)
   ;  R6 = irq_bits (Bits)
   ;Exit
   ;  R1 = unclaimed (Bool)
   ;  R2 = controller_out (pointer to data)
   ;  R3 = status_location_out (pointer to Int)
   ;  R4 = status_bits_out (Bits)
   ;  R5 = irq_location_out (pointer to Int)
   ;  R6 = irq_bits_out (Bits)

Service_ADFSPoduleIDE           *       &10801
   ;Entry
   ;  R1 = &10801
   ;  R2 = controller (pointer to data)
   ;  R3 = status_location (pointer to Int)
   ;  R4 = status_bits (Bits)
   ;  R5 = irq_location (pointer to Int)
   ;  R6 = irq_bits (Bits)
   ;  R7 -> read_code (code)
   ;  R8 -> write_code (code)
   ;Exit
   ;  R1 = unclaimed (Bool)
   ;  R2 = controller_out (pointer to data)
   ;  R3 = status_location_out (pointer to Int)
   ;  R4 = status_bits_out (Bits)
   ;  R5 = irq_location_out (pointer to Int)
   ;  R6 = irq_bits_out (Bits)
   ;  R7 -> read_code_out (code)
   ;  R8 -> write_code_out (code)

Service_ADFSPoduleIDEDying      *       &10802
   ;Entry
   ;  R1 = &10802

        ]
        END
